-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Support using system llhttp library #10760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add a new `USE_SYSTEM_DEPS` environment variable that can be used to enable building against the system install of llhttp library rather than the vendored one. This is implemented using the `pkgconfig` package to query llhttp install via pkg-config. The package is only used when `USE_SYSTEM_DEPS` is enabled, however due to limitations of `pyproject.toml` it is listed unconditionally as a build dependency. That said, flake8 claims that the dependency is not listed and I don't really know how to solve that: ``` setup.py:36:5: I900 'pkgconfig' not listed as a requirement ``` I have also updated `aiohttp/_cparser.pxd` to reference the `llhttp.h` header via its name rather than full path. I have poisoned the system header to confirm that the correct header is used both when building against the system library and the vendored library.
CodSpeed Performance ReportMerging #10760 will not alter performanceComparing Summary
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #10760 +/- ##
=======================================
Coverage 98.72% 98.72%
=======================================
Files 125 125
Lines 37793 37858 +65
Branches 2085 2091 +6
=======================================
+ Hits 37310 37375 +65
Misses 335 335
Partials 148 148
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, I'd like this wired via PEP 517 config settings but that's something to implement after redoing packaging similar to yarl. So it's out of the scope.
As for isort, there might be configs you'd need to add the new lib in.
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
Gentle ping. Do you have any further requests? |
@mgorny hey, sorry, Nick was running the PyCon US sprint almost by himself and I was being pulled into numerous discussions and brainstorming sessions, not being able to catch up with the aiohttp sprint.. I'll try to take a look shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, this is good bit would like more 👀 just in case..
Not my area of expertise, so I was just waiting on your review. No obvious issues that I see. |
Backport to 3.12: 💚 backport PR created✅ Backport PR branch: Backported as #10929 🤖 @patchback |
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]> (cherry picked from commit 4152a08)
Thanks @mgorny |
…ry (#10929) Co-authored-by: Michał Górny <[email protected]> Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
Thank you! |
What do these changes do?
Add a new
USE_SYSTEM_DEPS
environment variable that can be used to enable building against the system install of llhttp library rather than the vendored one.This is implemented using the
pkgconfig
package to query llhttp install via pkg-config. The package is only used whenUSE_SYSTEM_DEPS
is enabled, however due to limitations ofpyproject.toml
it is listed unconditionally as a build dependency. That said, flake8 claims that the dependency is not listed and I don't really know how to solve that:I have also updated
aiohttp/_cparser.pxd
to reference thellhttp.h
header via its name rather than full path. I have poisoned the system header to confirm that the correct header is used both when building against the system library and the vendored library.Are there changes in behavior for the user?
pkgconfig
build requirementUSE_SYSTEM_DEPS
will be using the system llhttp libraryIs it a substantial burden for the maintainers to support this?
I don't think so. The code uses
pkg-config
, so it should be pretty forward-secure to potentially nonstandardllhttp
installs. On top of that, presumably the feature will be primarily used by downstreams / expert users, who would rather be willing to submit fixes, should any issues arise (though that implies the burden of reviewing them).Related issue number
Discussion #10759.
Checklist
CONTRIBUTORS.txt
CHANGES/
foldername it
<issue_or_pr_num>.<type>.rst
(e.g.588.bugfix.rst
)if you don't have an issue number, change it to the pull request
number after creating the PR
.bugfix
: A bug fix for something the maintainers deemed animproper undesired behavior that got corrected to match
pre-agreed expectations.
.feature
: A new behavior, public APIs. That sort of stuff..deprecation
: A declaration of future API removals and breakingchanges in behavior.
.breaking
: When something public is removed in a breaking way.Could be deprecated in an earlier release.
.doc
: Notable updates to the documentation structure or buildprocess.
.packaging
: Notes for downstreams about unobvious side effectsand tooling. Changes in the test invocation considerations and
runtime assumptions.
.contrib
: Stuff that affects the contributor experience. e.g.Running tests, building the docs, setting up the development
environment.
.misc
: Changes that are hard to assign to any of the abovecategories.
Make sure to use full sentences with correct case and punctuation,
for example:
Use the past tense or the present tense a non-imperative mood,
referring to what's changed compared to the last released version
of this project.